package com.tianya.test.controller;

import org.jasig.cas.client.util.AssertionHolder;
import org.jasig.cas.client.validation.Assertion;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/sso")
public class SsoController {
    /**
     * 查询图片目录列表
     */
    @GetMapping("/one")
    @ResponseBody
    public String one() {
        Assertion assersion = AssertionHolder.getAssertion();
        String loginName = assersion.getPrincipal().getName();
        return loginName;
    }
}
